package com.niit.syy.unit_priceByhouse_type;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;

public class Unit_priceByhouse_typePartitioner extends Partitioner<Text, Text> {

    @Override
    public int getPartition(Text text01, Text text02, int i) {
        String unitPrice = text01.toString();
        if (unitPrice.equals("15001元/㎡")) {
            return 5;
        } else if (unitPrice.equals("12001-15000元/㎡")) {
            return 4;
        } else if (unitPrice.equals("9001-12000元/㎡")) {
            return 3;
        } else if (unitPrice.equals("6001-9000元/㎡")) {
            return 2;
        } else if (unitPrice.equals("3001-6000元/㎡")) {
            return 1;
        } else if (unitPrice.equals("0-3000元/㎡")) {
            return 0;
        }
        return 0;
    }
}
